<?php
/**
 *  投票记录类
 *
 * */
namespace app\admin\controller;

class Votelog extends Base
{
    protected $votelogModel;
    protected $activityModel;

    protected function initialize()
    {
        parent::initialize();
        $this->votelogModel = \app\common\model\VoteLog::getInstance();
        $this->activityModel = \app\common\model\Activity::getInstance();
    }

    /**
     * 投票记录
     * Votelog/listTpl
     * */
    public function listTpl()
    {

        $where = [];
        $list = $this->votelogModel->alias('a')->field('a.*,b.title')->join('activity b','b.id=a.activity_id')->where($where)->paginate(20, false, ['query' => request()->param()]);

        dump($list);
        $this->assign('list',$list);
        return $this->fetch('listtpl');
    }



}